package com.supreme.studyserver.utils.corlogger;

public abstract class AbstractLogger {

    public static int ZERO = 0;
    public static int ONE = 1;
    public static int TWO = 2;
    public static int THREE = 3;
    public static int FOUR = 4;
    public static int FIVE = 5;
    public static int SIX = 6;

    protected int level;

    protected AbstractLogger nextLogger;

    public AbstractLogger(int level) {
        this.level = level;
    }

    abstract protected void write(String message);

    public void setNextLogger(AbstractLogger nextLogger) {
        this.nextLogger = nextLogger;
    }

    public void showLogger(int level, String message) {
        if (this.level <= level) {
            this.write(message);
        }

        if (this.nextLogger != null) {
            this.nextLogger.showLogger(level, message);
        }
    }
}
